<?php

declare (strict_types = 1);

namespace app\adminapi\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
      'username'  => 'require|max:32|min:3',
      'nickname'  => 'require|max:30|min:1',
      'password'  => 'require',
    ];

    protected $message  =   [
      'username.require' => '请填写管理员账号',
      'password.require' => '请填写管理员密码',
    ];
  
    protected $scene = [
      'add'    =>  ['username', 'nickname', 'password'],
      'edit'    =>  ['username', 'nickname'],
    ];    
}